import axiosInstance from '../axiosself'


export default{
    getTable(PageNum,PageSize){
       return axiosInstance.get(`/admin/GetUser?PageNum=${PageNum}&PageSize=${PageSize}`)
    },
    
    Uplodimg(params){   
        const file = params.file;
        // 使用FormData传参数和文件
        const form = new FormData();
        // 添加键值对
        form.append("imageFile", file);
        //  form.append("date", this.urlId);
        // 传给后台FormData， 此时form = {date: xx, file: xxx(FormData)}
        return axiosInstance.post("/uploadimg", form);

    },

    UploadData(params){
        return axiosInstance.get(`/UploadData/UpdataUpdata?uuid=${params.uuid}&address=${params.address}&kind=${params.kind}&time=${params.time}&name=${params.name}&code=${params.code}&img=${params.img}`);
    },


    //按条件查询

    DelUser(userid){
        return axiosInstance.get(`/admin/DelUser?userid=${userid}`)
    },
    GetCode(){
        return axiosInstance.get(`/admin/GetCode`)
    },
    UpdataUser(prop){
        return axiosInstance.get(`/admin/UpdataUser?username=${prop.username}&userid=${prop.userid}&sex=${prop.sex}&root=${prop.root}&passward=${prop.passward}&img=${prop.userimg}`)
    }
}